<?php

namespace app\web\controller;

use app\web\controller\base\Base;

class Index extends Base
{
    /**
     * @return string
     */
    public function index()
	{
		$this->assign('version', '1.4.0');

	    return $this->render();
	}

    /**
     * 测试模版foreach循环
     *
     * @return string
     */
	public function run()
    {
        $users = [
            ['id' => 100, 'nickname' => 'tommy', 'age' => 18],
            ['id' => 101, 'nickname' => 'jack', 'age' => 25],
            ['id' => 102, 'nickname' => 'Luck', 'age' => 22]
        ];

        return $this->render('', [
            'users' => $users,
            'title' => '说好的幸福呢'
        ]);
    }
}
